<template>
  <view class="QRCode">
    <view class="container">
      <view class="leftDot"></view>
      <view class="rightDot"></view>
      <view class="glassInfo">
        <view class="title1">镜到了~</view>
        <view class="title2">{{orderItemObj.o_glasses_num}}副3D眼镜</view>
      </view>
      <view class="Qrcode">
        <view class="code">
          <image v-if="!!orderItemObj.o_get_qrc_url" class="imgCode" :src="orderItemObj.o_get_qrc_url"/>
        </view>
        <view class="saveToLocal">还有<text style="color: red;">{{ orderItemObj.o_glasses_num - (orderItemObj.num || 0) }}</text>副未取</view>
      </view>
    </view>
    <view class="optionArea">
      <AtButton style="margin-top: 40rpx; width: 500rpx;" type='primary' @click="gotoOrder">继续下单</AtButton>
    </view>
    
  </view>
</template>

<script setup>
import './index.scss'
import { AtButton } from 'taro-ui-vue3'
import Taro, {useDidShow} from '@tarojs/taro'
import {queryOrderInfo} from '../../http/api'

import {ref} from 'vue'
const orderItemObj = ref({})

function gotoOrder () {
  Taro.switchTab({
    url: '/pages/index/index'
  })
}
useDidShow(() => {
  let params =Taro.getCurrentInstance().router.params
  queryOrderInfo({o_order_code: params.o_order_code }).then(res => {
    if (res.code == '1000') {
      orderItemObj.value = res.data;
    }
  })
})
Taro.showShareMenu({
  withShareTicket: true,
  menus: ['shareAppMessage', 'shareTimeline']
})
</script>
